TIME 0

! Time in seconds. If the first time is left out, script starts at 0

START REPEAT COMPLETE
START REPEAT A
! These start repeat sections. You can give them any names you like
! You can leave out the name if only one repeat section is needed.
!
! Lines begining wtih exclamations are comments.

!This sets the frequency of the 1/1. 
FREQUENCY 330

! This sets the voice for part 1 to timpani
! You need the underlines between the words here

VOICE_WITH_PART 1 TIMPANI
OCTAVE_SHIFT_WITH_PART 1 -2

! Part 2 to harp
VOICE_WITH_PART 2 harp
OCTAVE_SHIFT_WITH_PART 2 -1

! Part 3 to FLUTE
VOICE_WITH_PART 3 FLUTE
OCTAVE_SHIFT_WITH_PART 3 0

! Three parts
PARTS_IN_PLAY 3

SEED 0 -1 2 0
TEMPO 60
VOLUME 127

! You can set anything else in the same way. The ones shown here
! are special shortcuts, but  you can set the text for nearly any field
! in FTS - see the section on autoscript and ids at the end of this script
! Instructions are case insensitive.

TIME 15

OCTAVE_SHIFT_WITH_PART 1 0
VOICE_WITH_PART 1 violin
TEMPO 120
SEED 0 3 0 2  ; 1 1.415 0.585 1  * 127 74.404 21.808 85.949 
PARTS_IN_PLAY 1

TIME 30

!This  repeats eveything again from START_REPEAT A
! three times

REPEAT A 3

! Gets here after the third repeat, will actually be  90 secs from the start of
! the tune
! - but only  30.0 seconds into the script because of the repeats

TIME 30
PARTS_IN_PLAY 2

TIME 60

SEED 0 -1 2 1 0

! You can enter times using minutes before a colon. You can also use a decimal point for fractions of a second
! So, this  has the same effect as TIME 70.5

TIME 1:10.5

! This repeats the entire script again from START_REPEAT COMPLETE
! As no number of repeats is given, it does it endlessly

REPEAT COMPLETE


COMMENTS

Anything after this point gets ignored - all the way to the end, or you can have an END COMMENTS line if
you want to put a section like this in the middle of your script.

 Taking this further -
 you can enter data into most text fields in FTS via the script and switch the check boxes on and off. 

***************Resets*******************

 At the start of the tune, one needs to set the original values for 
 anything you will be changing, if you want the tune to
 start the same way every time.

 That way,  if you stop the tune and start it again
 it will always start with the same settings. 

If you do it using auto script then the resets get put in that section automatically.

When you stop the tune, if you have Play script selected at the time, the tune will get played through to the end of the time 0 section, as a way of making sure that if you play the tune with scripting switched off you hear it the same way as you hear it at the start of the script.

 Another possibility is to start with a  NEW TUNE instruction - then you will need
 to put in the instructions for everything you need
 to set up the current tune after that.

 Another alternative is to place your original tune into a tempo map zone - 
 go to the Tempo Map window, and open your tune into a zone
 (doesn't matter that you are opening the tune into a zone of
 itself as it makes a copy of the tune as a sub tune)

 Then for instance if you loaded it into zone 1, you can
 then reset to the original tune at any time n the script using
 the instruction

 ZONE 1

See the section  on zones at the end of this example script.

The zones based approach however isn't recommended except in special situations
- if the script plays a zone, it works like playing a tune in 
a play list, so will ERASE ALL CHANGES TO THE TUNE THAT THE
USER MAY HAVE MADE AT THAT POINT.

Better to use the expliciet resets you get with autoscript.
Then user can change anythign else, and only the things
that actually get scripted will override what the user does.

***********Ids and auto script***************

 Each field in FTS has an id, and to enter its data, just place the id here followed by the new data.
 You can find the id by going to Help | Tool Tip help - then select the option to show ids
 Then when you click on any control you will see its id  in the tool tip help window
 - then you can copy and paste it here and then place the desired data after it.
 Use on or off to switch check boxes on or off.

 An easy way to do it is to switch on auto scripting. Then whenever you click on an
 text box, or check box, the id will be automatically placed in the script
 at your current editing position, along with the data needed to set it to
 its current value.

 You can use Ctrl + Shift + click on any field in a window to auto script most of the values in
 the window that affect the tune n one go.
 (a few may be left out and need to be done individually)

This may not set all the fields in the window, and some ids may get set but have no
effect. I will update thiis script here to show which windows work as testing and
bug fixing of this scripting continues. Currently none checked completely,
but probably Parts window is okay.

***********SKIP and GOTO***************

 You can also use the Skip instruction to skip forward in the current tune,
 e.g. 
 SKIP 20
 will skip foward 20 seconds (fast forward silently as for the tune bookmarks).

The skip instruction fast forwards the tune without changing
the position in the script.
If you want to move in the script, you can use a GOTO and LABEL
instructions.

Example:

GOTO CODA

various instructions

LABEL CODA

Then all the instructions in between get skipped and the script time skips
forward to the script time for  label A.

You can also do a conditional goto:

ON REPEAT 3 R CODA

This goes to the CODA label on the third repeat of the repeat 
from R.

Like this:

START REPEAT R

Instructions A

ON REPEAT R 3  CODA

instructions B

REPEAT R  3
LABEL CODA

instructions C

which will play

A B A B A C


***********Playing Play List zones***************

 This script can also be used to play tunes in the current play list. The instruction
 ZONE 2

or
TUNE 2

 loads and plays  the tune for the second play list zone. 
 
After that instruction, you can do things like change the instruments etc
 - just script as normal and your script will modify the
 tune you just loaded with that instruction.

Be sure to have the check box selected to save the play list
as part of the curren tune so that you can use it with the script.

 You need to have a tune for  the zone for this to work
 - which you do using the Open button in the Tempo map window.
 If there is no tune for the zone the instruction will just be ignored.

 You don't need to have  the play list switched on for this - in fact it is better with it switched off
 otherwise you will get the tempo map changes as well (unless you want those)

 Note that  if you make changes to one of the tunes in the play list,
you need to reopen it into the play list before it will affect it as
a zone tune. That's because when you open the tune into the play list
 zone, actually that makes a copy of it and stores the copy as a zone tune
 of the current tune.

 This means that your  tune and all its tempo map zone tunes
can be saved as a single file which is more convenient for the 
 programming and for the user too - if you want to send
 a play list with all its zone  tunes to someone you just need to
 send them a single file.

*****************Using zones to do a reset at the start of the tune************

 One use of the zones apart from playing different tunes is to reset
 everything at the start of the script.

 just open the current tune into one of the zones
  which you can do. It works because it makes a copy of the
 tune as a sub tune of itself.

Then just use the zone as, e..g if it is in zone 1:
ZONE 1

as a reset.

 Then when you play that zone, everything gets set to the values
 as they were when you opened it into that zone.



=============Chord Progressions===================

Normally when the script changes to the new chord progression it keeps the same position in the progression.

This means you can change to a new progression that is changed only in one chord and it will just keep playing right through, and will only be different when it
gets to the changed chord, which will normally be what one wants in that situation.
 
However if the new progression is a completely different one, you probably want to start from the beginning again. You can do that with:
 
NEXT CHORD 1
 
which sets it so that the next chord it plays is the first chord n the current chord progression. You can set any number there to skip to any position
in the progression at any time.
 